//
//  JZDemoViewController.swift
//  SwiftWeibo
//
//  Created by Stone on 16/12/2.
//  Copyright © 2016年 Stone. All rights reserved.
//

import UIKit

class JZDemoViewController: JZBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        title = "第\(navigationController?.childViewControllers.count ?? 0)个"
    }
    
    func nextVC() {
        let vc = JZDemoViewController()
        navigationController?.pushViewController(vc, animated: true)
    }
    
}

extension JZDemoViewController {
    
    override func setUpTableView() {
       
        super.setUpTableView()
        //设置导航栏按钮
        //下面这种方法没有办法高亮
        //navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(nextVC))
        //        let btn: UIButton = UIButton.cz_textButton("下一个", fontSize: 16, normalColor: UIColor.darkGray, highlightedColor: UIColor.orange)
        //
        //        btn .addTarget(self, action: #selector(nextVC), for: .touchUpInside)
        //
        //        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn)
        
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(nextVC))
    }
    
    
}
